package com.eascs.admin.o2o.internal.dao;

import org.springframework.stereotype.Repository;

import com.eascs.admin.common.dao.BaseO2oDao;
import com.eascs.admin.o2o.internal.entity.PubDditem;

/**
 * 
 * 字典详情表 Dao
 *
 */
@Repository
public class PubDditemDao extends BaseO2oDao{
	/**
	 * 根据dd_no和item_code查询出 字典实体
	 * @param dd_code
	 * @param code
	 * @return
	 */
	public PubDditem queryPubDditem(String dd_code,String code){
		String sql="select item_name from pub_dditem t where dd_no=? and t.item_code=?";
		return this.findEntity(sql, PubDditem.class, dd_code.trim(),code.trim());
	}
	/**
	 * 根据dd_no和item_code查询出 字典实体
	 * @param dd_code
	 * @param code
	 * @return
	 */
	public PubDditem queryPubDditemO2o(String dd_code,String code){
		String sql="select item_name from pub_dditem_o2o t where  dd_no=? and t.item_code=?";
		return this.findEntity(sql, PubDditem.class,dd_code.trim(), code.trim());
	}
	/**
	 * 根据dd_no和item_code查询出表 pub_dditem_crm字典实体
	 * @param dd_code
	 * @param code
	 * @return
	 */
	public PubDditem queryPubDditemCRM(String dd_code, String code) {
		String sql="select item_name from pub_dditem_crm t where  dd_no=? and t.item_code=?";
		return this.findEntity(sql, PubDditem.class,dd_code.trim(), code.trim());
	}
}
